package com.yang.frost.blueberry.controller;

import com.yang.frost.blueberry.config.annotation.Log;
import com.yang.frost.blueberry.params.WxMpParam;
import com.yang.frost.blueberry.util.ApiResult;
import com.yang.frost.blueberry.weixin.params.WxBaseParam;
import com.yang.frost.blueberry.weixin.service.WxMpService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletResponse;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author 10296
 * @date 2021/4/15
 * @Description: 获取粉丝列表信息
 */
@RestController
@RequestMapping("/wxMpApi")
@Api(value = "公众号管理API", tags = {"公众号管理Api"})
public class WxMpController {

    private Logger logger = LoggerFactory.getLogger(this.getClass());
    @Autowired
    private WxMpService wxMpService;

    @Log("")
    @PostMapping("/qryWxAccount")
    @ApiOperation(value = "微信公众号-->查询粉丝列表", notes = "微信公众号-->查询粉丝列表")
    public ApiResult qryWxAccount(WxMpParam params, HttpServletResponse response) {
        Map<String, Object> retMap = new HashMap<>(1);
        try {
            List<Map<String, Object>> maps = wxMpService.qryWxAccount(params);
            retMap.put("rows", maps);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return ApiResult.ok(retMap);
    }


}
